package DatabaseUpdate;

import java.util.Observable;
import java.util.Observer;

import Watch.DirDataChanges;

public class DBObserver implements Observer
{
	//instance of DatabaseUpdater
	DatabaseUpdater updater;
	DirDataChanges dirDataChange = null;
	
	public DBObserver(DatabaseUpdater newUpdater) 
	{
		updater = newUpdater;
	}
	
	@Override
	public void update(Observable arg0, Object arg1) 
	{
		System.out.println("i was notified");
		//get the object with the changes
		dirDataChange = (DirDataChanges)arg1;
		updater.jobsQueue.add(dirDataChange);
		System.out.println("i added the change");
	}
}
